<h1 id="title" class="title">登录</h1>
<p class="sub-title">使用手机号码进行登录</p>
<!-- <p>{{ promise | async }}1111</p> -->


<form (ngSubmit)="submit()" [formGroup]="userForm" aria-labelledby="title">

  <div class="form-control-group">
    <label class="label" for="input-email">手机号码:</label>
    <input nbInput fullWidth formControlName="loginName"
    [status]="userForm.get('loginName').dirty ? (userForm.get('loginName').invalid  ? 'danger' : 'success') : ''"
    >
    <ng-container *ngIf="userForm.get('loginName').invalid">
      <p class="error-message">
        {{GetErrMsg(this.userForm.get("loginName"))}}
      </p>
    </ng-container>
  </div>

  <div class="form-control-group">
    <label class="label" for="input-password">密码:</label>
    <input nbInput fullWidth formControlName="password" type="password" id="input-password" placeholder="登录密码">
    <ng-container *ngIf="userForm.get('password').invalid">
      <p class="error-message">
        {{GetErrMsg(this.userForm.get("password"))}}
      </p>
    </ng-container>
  </div>

  <div class="form-control-group accept-group">
    <nb-checkbox name="rememberMe" [(ngModel)]="rememberMe" *ngIf="rememberMe">记住我</nb-checkbox>
    <!-- <a class="forgot-password" routerLink="../request-password">Forgot Password?</a> -->
  </div>

  <button nbButton fullWidth status="success" [class.btn-pulse]="submitted">
    提交
  </button>
</form>